/*
 * File:   ImageResizerTest.cpp
 * Author: Guilherme Monteiro
 *
 */

#include "ImageResizerTest.h"


CPPUNIT_TEST_SUITE_REGISTRATION(ImageResizerTest);

ImageResizerTest::ImageResizerTest() {
}

ImageResizerTest::~ImageResizerTest() {
}

void ImageResizerTest::setUp() {
}

void ImageResizerTest::tearDown() {
}

void ImageResizerTest::testResize() {
    string np = "../books/mensagem/baixa_resolucao/image112.png";
    IplImage* img1 = cvLoadImage(np.c_str());
    ImageResizer* resizer = new ImageResizer();
    IplImage* img2 = resizer->resize(img1, 475, 600);

//    cvShowImage("image resized", img2);
//    cvNamedWindow("image resized", CV_WINDOW_FREERATIO);
//    cvWaitKey(0);
//    cvDestroyWindow("image resized");

    if (img2->height != 600 || img2->width != 475) {
        CPPUNIT_ASSERT(false);
    }

    cvReleaseImage(&img2);
}
